﻿@model PagedList<Background.Core.Entity.WebDepartments>
@{
    ViewBag.Title = "Index";
}
<h2>
    Index</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
        </th>
        <th>
            部门编号
        </th>
        <th>
            名称
        </th>
        <th>
            上级编号
        </th>
        <th>
            排序
        </th>
        <th>
            状态
        </th>
    </tr>
    @if (Model != null && Model.Count > 0)
    {
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.ActionLink("Edit", "Edit", new { id = item.DepartmentID }) |
                        @Html.ActionLink("Details", "Details", new { id = item.DepartmentID }) |
                        @Html.ActionLink("Delete", "Delete", new { id = item.DepartmentID })
                    </td>
                    <td>
                        @item.DepartmentID
                    </td>
                    <td>
                        @item.DepartmentName
                    </td>
                    <td>
                        @item.ParentID
                    </td>
                    <td>
                        @item.SortNumber
                    </td>
                    <td>
                        @item.Status
                    </td>
                </tr>
            }
        </tbody>
        <tfoot>
            <tr>
                <td colspan="6">@Html.Pager(Model)
                </td>
            </tr>
        </tfoot>
    }
</table>
